package service.Impl;

import Dao.EmpDao;
import Dao.Impl.EmpDaoImpl;
import bean.Emp;
import service.EmpService;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

public class EmpServiceImpl implements EmpService {
    EmpDao dao = new EmpDaoImpl();
    private Object List;
    private String name;

    /**
     * 获取员工所有信息方法
     *
     * @return
     */
    @Override
    public List<Emp> getAllEmp() {
        List<Emp> empList=  dao.getAllEmp();
        return empList;
    }

    @Override
    public void addEmp(Emp emp) {
        dao.addEmp(emp);
    }

    @Override
    public int delEmp(int empno) {
        int x = dao.delete(empno);
        return x;
    }

    @Override
    public void upData(int empn) {
        dao.upDate(empn);
    }

    @Override
    public List<Emp> selectEmp(String name) {
        List<Emp> emps = dao.selectEmp(name);
        return emps;

    }
}

